package com.huawei.hwid.core.datatype;

import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable.Creator;
import android.text.TextUtils;
import com.huawei.hwid.core.d.b.e;
import java.util.ArrayList;
import org.json.JSONArray;
import org.json.JSONException;
import org.xmlpull.v1.XmlPullParser;

public class ReadWhiteListInfo implements Parcelable {
    public static final Creator<ReadWhiteListInfo> CREATOR = new Creator<ReadWhiteListInfo>() {
        public /* synthetic */ Object createFromParcel(Parcel parcel) {
            return a(parcel);
        }

        public /* synthetic */ Object[] newArray(int i) {
            return a(i);
        }

        public ReadWhiteListInfo a(Parcel parcel) {
            return new ReadWhiteListInfo(parcel);
        }

        public ReadWhiteListInfo[] a(int i) {
            return new ReadWhiteListInfo[i];
        }
    };

    protected ReadWhiteListInfo(Parcel parcel) {
    }

    public void writeToParcel(Parcel parcel, int i) {
    }

    public int describeContents() {
        return 0;
    }

    public static void a(XmlPullParser xmlPullParser, ArrayList<String> arrayList, String str) {
        int i = 0;
        if (xmlPullParser != null && str != null && "hosts".equals(xmlPullParser.getAttributeName(0))) {
            Object attributeValue = xmlPullParser.getAttributeValue(0);
            if (!TextUtils.isEmpty(attributeValue)) {
                try {
                    JSONArray jSONArray = new JSONArray(attributeValue);
                    while (i < jSONArray.length()) {
                        arrayList.add(jSONArray.getString(i));
                        i++;
                    }
                } catch (JSONException e) {
                    e.b("ReadWhiteListInfo", "JSONException", true);
                }
            }
        }
    }
}
